package com.example.unique.ui.status

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import com.example.unique.database.DatabaseHelper
import com.example.unique.database.DatabaseJob
import com.example.unique.databinding.FragmentSlideshowBinding
import com.example.unique.ui.home.HomeViewModel

class StatusFragment : Fragment() {

    private var _binding: FragmentSlideshowBinding? = null
    private lateinit var userDatabase:DatabaseHelper
    private lateinit var jobDatabase:DatabaseJob
    private lateinit var sno:String
    private lateinit var club:String
    private val binding get() = _binding!!
    private lateinit var statusViewModel: StatusViewModel
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        // 初始化数据库实例
        jobDatabase = DatabaseJob.getInstance(requireContext())
        userDatabase= DatabaseHelper(requireContext())
        // 初始化 ViewModel
       // homeViewModel = HomeViewModel(jobDatabase)
        statusViewModel= StatusViewModel()
        // 从 Activity 获取社团信息
        club = activity?.intent?.getStringExtra("club").orEmpty()
    }
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {
        _binding = FragmentSlideshowBinding.inflate(inflater, container, false)
        val root: View = binding.root
        return root
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

    }
    override fun onDestroyView() {
        super.onDestroyView()
        _binding = null
    }
}